import { request } from '@/utils/axios';
import { indexApi } from '@/api/allUrl'

/**
 * @description: 登录
*/
export function loginApi(params: object) {
    return request.post(
        indexApi.login,
        params
    );
}

/**
 * @description: 注册
*/
export function registerApi(params: object) {
    return request.post(
        indexApi.register,
        params
    );
}

export function addLoginMobileApi(params: object) {
    return request.post(
        indexApi.addLoginMobileUrl,
        params
    );
}


/**
 * @description: 退出登录
*/
export function loginOutApi() {
    return request.get(
        indexApi.loginOutUrl,
    );
}
/**
 * @description: 获取用户详情
*/
export function getUserInfoApi() {
    return request.get(
        indexApi.userInfoUrl,
    );
}
/**
 * @description: 微信登录
*/
export function wechartLoginApi() {
    return request.get(
        indexApi.wechartLoginUrl,
    );
}
// 微信登录回调接口
export function loopCallbackApi(params: any) {
    return request.get(
        indexApi.loopCallback + `?randomSession=${params.randomSession}`,
    );
}




/**
 * @description: 获取验证码
*/
export function getCodeApi(params: any) {
    return request.get(
        indexApi.getCodeUrl + `?userName=${params.userName}`,
    );
}

/**
 * @description: 上传图片
*/
export function updateFileApi(params: any) {
    return request.postUpdate(
        indexApi.updateFileUrl,
        params,
    );
}
/**
 * @description: 上传cad文件
*/
export function updateCadApi(params: any) {
    return request.postUpdate(
        indexApi.updateCadFileUrl,
        params,
    );
}

/**
 * @description: 添加户型
*/
export function saveHouseApi(params: object) {
    return request.post(
        indexApi.saveHouseUrl,
        params
    );
}
/**
 * @description: 查询户型
*/
export function getHouseListApi(params?: object) {
    return request.post(
        indexApi.getHouseListUrl,
        params
    );
}

/**
 * @description: 我的上传
*/
export function getMyUpdateApi(params?: object) {
    return request.post(
        indexApi.getMyUpdateUrl,
        params
    );
}

/**
 * @description: 发布赏金任务
*/
export function releaseApi(params: object) {
    return request.post(
        indexApi.releaseUrl,
        params
    );
}

/**
 * @description: 修改赏金任务
*/
export function editReleaseApi(params: object) {
    return request.post(
        indexApi.editReleaseUrl,
        params
    );
}


/**
 * @description: 获取公共赏金任务
*/
export function getReleaseListApi(params: any) {
    return request.post(
        indexApi.getReleaseListUrl + `?current=${params.current}&size=${params.size}`,
        params
    );
}

/**
 * @description: 获取我发布的赏金任务
*/
export function getMyReleaseListApi(params: any) {
    return request.post(
        indexApi.getMyReleaseListUrl + `?current=${params.current}&size=${params.size}`,
        params
    );
}

/**
 * @description: 获取公共赏金任务详情
*/
export function getReleaseDetailApi(params: any) {
    return request.get(
        indexApi.getReleaseDetailUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 删除我的发布
*/
export function delReleaseApi(params: any) {
    return request.get(
        indexApi.delReleaseUrl + `?id=${params.id}`,
    );
}

/**
 * @description: 获取户型详情
*/
export function getHouseDetaiApi(params: any) {
    return request.get(
        indexApi.getHouseDetailUrl + `?id=${params.id}`,

    );
}
/**
 * @description: 获取我的上传详情
*/
export function getMyUpdateInfoApi(params: any) {
    return request.get(
        indexApi.getMyUpdateInfoUrl + `?houseId=${params.id}`,

    );
}


/**
 * @description: 下载户型文件
*/
export function downHouseFileApi(params: any) {
    return request.postBlobDownload(
        indexApi.downHouseFileUrl,
        params
    );
}

/**
 * @description: 获取轮播图
*/
export function getSwiperApi(params: any) {
    return request.get(
        indexApi.getSwiperUrl + `?type=${params.type}`,
    );
}

/**
 * @description: 首页热搜月榜
*/
export function getHotSearchApi() {
    return request.get(
        indexApi.hotSearchUrl
    );
}
/**
 * @description: 首页最新上传月榜
*/
export function getNewUpdateApi() {
    return request.get(
        indexApi.getNewUpdateUrl
    );
}
/**
 * @description: 首页高定上传月榜
*/
export function getGaoUpdateApi() {
    return request.get(
        indexApi.getGaoUpdateUrl
    );
}
/**
 * @description: 首页上传收入排行榜
*/
export function getIncomeRankingApi() {
    return request.get(
        indexApi.incomeRankingUrl
    );
}



/**
 * @description: 统计我的上传信息
*/
export function myStatisticsApi() {
    return request.get(
        indexApi.myStatisticsUrl
    );
}

/**
 * @description: 获取设计助手列表信息
*/
export function getHelpListApi(num: number) {
    return request.get(
        indexApi.getHelpListUrl + `?current=${num}` + '&size=15',
    );
}
/**
 * @description: 获取设计助手详情信息
*/
export function getHelpDetailApi(id: number | string) {
    return request.get(
        indexApi.getHelpDetailUrl + `?designId=${id}`,
    );
}
/**
 * @description: 收藏房源
*/
export function shouCangApi(id: any) {
    return request.get(
        indexApi.shouCangUrl + `?houseId=${id}`,
    );
}

/**
 * @description: 收益月榜
*/
export function shouYiBangApi() {
    return request.get(
        indexApi.shouyiBangUrl,
    );
}

/**
 * @description: 取消收藏
*/
export function quXiaoshouCangApi(id: any) {
    return request.get(
        indexApi.quXiaoshouCangUrl + `?houseId=${id}`,
    );
}

/**
 * @description: 获取客服微信
*/
export function getKeFuImgApi() {
    return request.get(
        indexApi.getKeFuImgUrl,
    );
}
/**
 * @description: 查询收益统计
*/
export function getMineInComeApi() {
    return request.get(
        indexApi.getMineInComeUrl,
    );
}
/**
 * @description: 剩余可提现金额
*/
export function getShengYuMoneyApi() {
    return request.get(
        indexApi.getShengYuMoneyUrl,
    );
}

/**
 * @description: 首页 为您推荐
*/
export function getHouseRecommendedForApi() {
    return request.get(
        indexApi.getHouseRecommendedForUrl,
    );
}

/**
 * @description: 热门楼盘推荐
*/
export function getHouseHottestRecommendApi() {
    return request.get(
        indexApi.getHouseHottestRecommendUrl,
    );
}
/**
 * @description: 获取我的资产
*/
export function getMineAssetsApi() {
    return request.get(
        indexApi.getqueryMineAssetsUrl,
    );
}
/**
 * @description: 查询套餐列表
*/
export function getPackageListApi() {
    return request.get(
        indexApi.getPackageListUrl,
    );
}

/**
 * @description: 微信支付
*/
export function wechartPlayApi(params: object) {
    return request.post(
        indexApi.paymentUrl,
        params
    );
}
/**
 * @description: 资产统计
*/
export function generalAssetsApi() {
    return request.get(
        indexApi.generalAssetsUrl
    );
}

/**
 * @description: 提现户币
*/
export function tiXianBuBiApi(params: object) {
    return request.post(
        indexApi.tiXianBuBiUrl,
        params
    );
}
/**
 * @description: 兑换户币
*/
export function duiHuanBuBiApi(params: object) {
    return request.post(
        indexApi.duiHuanBuBiUrl,
        params
    );
}

/**
 * @description: 户型纠错
*/
export function reportedErrorApi(params: object) {
    return request.post(
        indexApi.reportedErrorUrl,
        params
    );
}


/**
 * @description: 查询支付状态
*/
export function getPayStatetApi() {
    return request.get(
        indexApi.getPayStatetUrl,
    );
}
/**
 * @description: 查询vip套餐
*/
export function getQueryListApi() {
    return request.get(
        indexApi.getQueryListUrl,
    );
}

/**
 * @description: 开通vip
*/
export function openMemberApi(params: any) {
    return request.get(
        indexApi.openMemberUrl + `?id=${params.id}`,
    );
}
/**
 * @description: 查询同小区户型
*/
export function getSaveHouseApi(params: any) {
    return request.get(
        indexApi.getSaveHouseUrl + `?id=${params.id}&current=${params.current}&size=${params.size}`,
    );
}
/**
 * @description: 查询我的收藏
*/
export function getMyShouCangApi(params: any) {
    return request.get(
        indexApi.getMyShouCangUrl + `?current=${params.current}&size=${params.size}`,
    );
}


/**
 * @description: 修改用户信息
*/
export function updateUserInfoApi(params: object) {
    return request.post(
        indexApi.updateUserInfoUrl,
        params
    );
}
/**
 * @description: 查询我的资产
*/
export function getMyMoneyApi(params: object) {
    return request.post(
        indexApi.getMyMoneyUrl,
        params
    );
}

/**
 * @description: 修改密码
*/
export function updatePasswordApi(params: object) {
    return request.post(
        indexApi.updatePasswordUrl,
        params
    );
}
/**
 * @description: 获取收益明细
*/
export function getIncomeInfoApi(params: object) {
    return request.post(
        indexApi.getIncomeInfoUrl,
        params
    );
}
/**
 * @description: 获取提现明细
*/
export function getTiXianInfoApi(params: object) {
    return request.post(
        indexApi.getTiXianInfoUrl,
        params
    );
}
/**
 * @description: 获取兑换明细
*/
export function getDuiHuanInfoApi(params: object) {
    return request.post(
        indexApi.getDuiHuanInfoUrl,
        params
    );
}


/**
 * @description: 获取用户头像
*/
export function getUserImgApi() {
    return request.get(
        indexApi.getUserImgUrl,
    );
}

/**
 * @description: 修改我的上传
*/
export function getEditMyUpdateApi(params: object) {
    return request.post(
        indexApi.editMyUpdateUrl,
        params
    );
}